package cn.yunhe.service;

import cn.yunhe.dao.IAdminDao;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class DelAdminService {
    SqlSession session= null;
    IAdminDao iAdminDao=null;

    public int delAdmin(int id){
        int flag=0;
        try{
            session= SqlSessionFactoryUtil.getSqlSession();
            iAdminDao=session.getMapper(IAdminDao.class);
            flag=iAdminDao.delAdmin(id);
            session.commit();
        }finally {
            session.close();
        }
        return flag;
    }
}
